//
//  FormatUtils.h
//  SZYH2
//
//  Created by WT on 13-6-10.
//  Copyright (c) 2013年 JMU. All rights reserved.
//

#import <Foundation/Foundation.h>

#define DEFAULT_DATE_FORMAT         @"yyyy-MM-dd"
#define DEFAULT_TIME_FORMAT         @"hh:mm:ss"
#define DEFAULT_DATETIME_FORMAT     @"yyyy-MM-dd hh:mm"
#define DEFAULT_DATETIME_24HFORMAT        @"yyyy-MM-dd HH:mm" // 24时制
#define DEFAULT_DATETIME_POINT_FORMAT     @"yyyy.MM.dd"

@interface FormatUtil : NSObject

+ (NSDate *)dateFromString:(NSString *)dateString withFormat:(NSString *)format;
+ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)format;

//返回大小信息：K M G
+ (NSString *)stringFromSize:(float)size;

// 返回时间类型
+ (NSString *)changeDateline:(SInt64)dateline;

// 计算间隔天数(算延迟，有延迟时返回负值)
+ (NSInteger)comparisonOfDays:(SInt64)date;
// 计算间隔分钟(算还剩x分钟，时间未到返回正数)
+ (NSInteger)comparisonOfMinutes:(SInt64)date;
// 计算间隔秒数
+ (NSInteger)comparisonOfSeconds:(NSDate *)date;
// 计算间隔毫秒数
+ (NSTimeInterval)comparisonOfMilliseconds:(NSDate *)date;

// 比较两个时间的大小: 1 > 2 返回true
+ (NSComparisonResult)compareDate:(SInt64)iTime1 andIntTime:(SInt64)iTime2;
+ (NSComparisonResult)compareDate:(NSString *)strTime1 andtime:(NSString *)strTime2;
+ (NSComparisonResult)compareDate:(NSDate *)date1 andDate:(NSDate *)date2;


@end
